import { createWebHistory, createRouter } from 'vue-router'
import Layout from '@/layout/index.vue'
import Home from '@/views/Home/index.vue'
import Songlist from '@/views/Songlist/index.vue'
import Singer from '@/views/Singer/index.vue'
import VIP from '@/views/VIP/index.vue'
import Player from '@/views/Player/index.vue'
import User from '@/views/User/index.vue'

const routes = [
    {
        path: '/',
        component: Layout,
        redirect: '/home',
        children: [
            {
                path: '/home',
                name: 'Home',
                component: Home
            },
            {
                path: '/songlist',
                name: 'Songlist',
                component: Songlist
            },
            {
                path: '/singer',
                name: 'Singer',
                component: Singer
            },
            {
                path: '/vip',
                name: 'VIP',
                component: VIP
            },
            {
                path: '/player',
                name: 'Player',
                component: Player
            },
            {
                path: '/user',
                name: 'User',
                component: User
            }
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router